import { configureStore, ThunkAction, Action } from '@reduxjs/toolkit';
import homeSlice from './home/homeSlice';
import classifySlice from './classify/classSlice'
import carSlice from './car/carSlice'
import logger from 'redux-logger'
export const store = configureStore({
  reducer: {
    home: homeSlice.reducer,
    classify: classifySlice.reducer,
    car:carSlice.reducer
  },
  middleware: (getDefaultMiddleware) => getDefaultMiddleware().concat(logger),
});

export type AppDispatch = typeof store.dispatch;
export type RootState = ReturnType<typeof store.getState>;
export type AppThunk<ReturnType = void> = ThunkAction<
  ReturnType,
  RootState,
  unknown,
  Action<string>
>;
